package springcloud.controller;

import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 咕唧
 * @Date 2022/6/28 10:38
 * @Version 1.0
 */
@RestController
public class MyErrorController implements ErrorController {
    @GetMapping("/error")
    public String error() {
        return " 这是fallback降级方法";
    }

    @Override
    public String getErrorPath() {
        //告诉spring,这个地址我们自己重写
        return "error";
    }
}
